package com.jprocms.module.cms.controller.admin.investigate.vo;

import com.jprocms.module.cms.controller.admin.investigateitem.vo.InvestigateItemCreateReqVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.util.List;

@Schema(description = "管理后台 - 问卷调查创建 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class InvestigateCreateReqVO extends InvestigateBaseVO {

    @Schema(description = "题目集合", example = "16241")
    private List<InvestigateItemCreateReqVO> items;

    public void init() {
        if (getInvestigateMode() == null) {
            setInvestigateMode((short) 1);
        }
        if (getInvestigateInterval() == null) {
            setInvestigateInterval(0);
        }
        setJoinNum(0);
        if (getEnabled() == null) {
            setEnabled(true);
        }
    }
}
